<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="com.situ.web.entity.Student"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
      <!-- EL可以从域对象中取出数据 -->
    <%
    //1.获取普通字符串
    request.setAttribute("name", "zhangsan");
    session.setAttribute("name", "wangeu");
    //2.获得Student对象的值
    Student student = new Student(1, "zajah", 23, "nan");
    session.setAttribute("student", student);
    //3.获取List<Student> list的值
	List<Student> list = new ArrayList<Student>();
	Student student1 = new Student(1, "张三11", 23, "男");
	Student student2 = new Student(2, "张三22", 23, "男");
	list.add(student1);
	list.add(student2);
	application.setAttribute("list", list);
    %>
   <!--  1.获取普通字符串 -->
    <%=request.getAttribute("name") %><br>
    <%=session.getAttribute("name") %><br>
    ${requestScope.name}<br>
    ${sessionScope.name}<br>
    ${name}
    <hr/>
    <!--2.获得Student对象的值  -->
    
    <%
    // Duplicate local variable student
    Student s = (Student)session.getAttribute("student");
    %>
    <%=s.getName()%><br>
    <%=s.getId() %><br>
    
    ${student.name}--${student.id}
   <hr/>
	<!-- 3.获取List<Student> list的值 -->
	<%
		List<Student> stuList = (List<Student>)application.getAttribute("list");
	%>
	<%=stuList.get(0).getName()%><br/>
	${list[0].name}<br/>
	
	${pageContext.request.contextPath}
	${request.contextPath}
   
    

</body>
</html>